import VueRouter from 'vue-router'

// 导入组件
import home from './components/tabber/homeContainer.vue'
import member from './components/tabber/memberContainer.vue'
import shopcar from './components/tabber/shopcarContainer.vue'
import setup from './components/tabber/setupContainer.vue'
import newList from './components/new/newList.vue'
import newInfo from './components/new/newsInfo.vue'
import photoShare from './components/photo/photoShare.vue'
import productList from './components/product/productList.vue'
import productInfo from './components/product/productInfo.vue'

// 3. 创建路由对象
var router = new VueRouter({
    routes:[
        {path: '/', redirect:'/home'},
        {path: '/home', component:home},
        {path: '/member', component:member},
        {path: '/shopcar', component:shopcar},
        {path: '/setup', component:setup},
        {path: '/home/newList', component:newList},
        {path: '/home/newInfo/:id', component:newInfo},
        {path: '/home/photoShare', component:photoShare},
        {path: '/home/productList', component:productList},
        {path: '/home/productInfo/:id', component:productInfo, name:"productInfo"},
    ],
    // 修改路由切换的样式
    linkActiveClass:'mui-active'
})

// 把路由对象暴露出去
export default router